package com.sx.zongzhi.adapter;


import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sx.zongzhi.R;
import com.sx.zongzhi.bean.PartiesBean;

import java.util.List;

/**
 * Created by XZY on 2017/11/23.
 * 当事人删除
 */

public class LitigantDeleteAdapter extends BaseQuickAdapter<PartiesBean,BaseViewHolder> {

    private List<PartiesBean> data;

    public LitigantDeleteAdapter(Context context, @LayoutRes int layoutResId, @Nullable List<PartiesBean> data) {
        super(layoutResId, data);
        this.data=data;
    }

    @Override
    protected void convert(BaseViewHolder helper, final PartiesBean item) {
        helper.setText(R.id.tv_Name,item.getPartyName());
        helper.getView(R.id.imv_Delete).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                data.remove(item);
                notifyDataSetChanged();
            }
        });
    }
}
